import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch_ros.actions import Node


def generate_launch_description():
   robot_config = os.path.join(
      os.getcwd(),
      'config',
      'cfg',
      'robot_config.yaml'
      )
   config = os.path.join(
      os.getcwd(),
      'config',
      'ubt_state',
      'cfg.yaml'
      )
   sys_config = os.path.join(
      os.getcwd(),
      'config',
      'common',
      'system_cfg.yaml'
      )
   server_config = os.path.join(
      os.getcwd(),
      'config',
      'cfg',
      'server_paramter.yaml'
      )



   log_level = 'info'

   return LaunchDescription([
      Node(
         package='ubt_state',
         executable='ubt_state_node',
         name='ubt_state',
         parameters=[config,sys_config,robot_config,server_config],
         ros_arguments=['--log-level', log_level]
      )
   ])